// --------------------------------------------------------------------------------------------
// Version: MPL 1.1/GPL 2.0/LGPL 2.1
// 
// The contents of this file are subject to the Mozilla Public License Version
// 1.1 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
// http://www.mozilla.org/MPL/
// 
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
// for the specific language governing rights and limitations under the
// License.
// 
// <remarks>
// Generated by IDLImporter from file nsIVariant.idl
// 
// You should use these interfaces when you access the COM objects defined in the mentioned
// IDL/IDH file.
// </remarks>
// --------------------------------------------------------------------------------------------
namespace Gecko
{
	using System;
	using System.Runtime.InteropServices;
	using System.Runtime.InteropServices.ComTypes;
	using System.Runtime.CompilerServices;
	
	
	/// <summary>
    ///The long avoided variant support for xpcom. </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("4d12e540-83d7-11d5-90ed-0010a4e73d9a")]
	public interface nsIDataType
	{
	}
	
	/// <summary>nsIDataTypeConsts </summary>
	public class nsIDataTypeConsts
	{
		
		// <summary>
        // From xpt_struct.h ...
        // </summary>
		public const long VTYPE_INT8 = 0;
		
		// <summary>
        // TD_INT8              = 0,
        // </summary>
		public const long VTYPE_INT16 = 1;
		
		// <summary>
        // TD_INT16             = 1,
        // </summary>
		public const long VTYPE_INT32 = 2;
		
		// <summary>
        // TD_INT32             = 2,
        // </summary>
		public const long VTYPE_INT64 = 3;
		
		// <summary>
        // TD_INT64             = 3,
        // </summary>
		public const long VTYPE_UINT8 = 4;
		
		// <summary>
        // TD_UINT8             = 4,
        // </summary>
		public const long VTYPE_UINT16 = 5;
		
		// <summary>
        // TD_UINT16            = 5,
        // </summary>
		public const long VTYPE_UINT32 = 6;
		
		// <summary>
        // TD_UINT32            = 6,
        // </summary>
		public const long VTYPE_UINT64 = 7;
		
		// <summary>
        // TD_UINT64            = 7,
        // </summary>
		public const long VTYPE_FLOAT = 8;
		
		// <summary>
        // TD_FLOAT             = 8,
        // </summary>
		public const long VTYPE_DOUBLE = 9;
		
		// <summary>
        // TD_DOUBLE            = 9,
        // </summary>
		public const long VTYPE_BOOL = 10;
		
		// <summary>
        // TD_BOOL              = 10,
        // </summary>
		public const long VTYPE_CHAR = 11;
		
		// <summary>
        // TD_CHAR              = 11,
        // </summary>
		public const long VTYPE_WCHAR = 12;
		
		// <summary>
        // TD_WCHAR             = 12,
        // </summary>
		public const long VTYPE_VOID = 13;
		
		// <summary>
        // TD_VOID              = 13,
        // </summary>
		public const long VTYPE_ID = 14;
		
		// <summary>
        // TD_PNSIID            = 14,
        // </summary>
		public const long VTYPE_DOMSTRING = 15;
		
		// <summary>
        // TD_DOMSTRING         = 15,
        // </summary>
		public const long VTYPE_CHAR_STR = 16;
		
		// <summary>
        // TD_PSTRING           = 16,
        // </summary>
		public const long VTYPE_WCHAR_STR = 17;
		
		// <summary>
        // TD_PWSTRING          = 17,
        // </summary>
		public const long VTYPE_INTERFACE = 18;
		
		// <summary>
        // TD_INTERFACE_TYPE    = 18,
        // </summary>
		public const long VTYPE_INTERFACE_IS = 19;
		
		// <summary>
        // TD_INTERFACE_IS_TYPE = 19,
        // </summary>
		public const long VTYPE_ARRAY = 20;
		
		// <summary>
        // TD_ARRAY             = 20,
        // </summary>
		public const long VTYPE_STRING_SIZE_IS = 21;
		
		// <summary>
        // TD_PSTRING_SIZE_IS   = 21,
        // </summary>
		public const long VTYPE_WSTRING_SIZE_IS = 22;
		
		// <summary>
        // TD_PWSTRING_SIZE_IS  = 22,
        // </summary>
		public const long VTYPE_UTF8STRING = 23;
		
		// <summary>
        // TD_UTF8STRING        = 23,
        // </summary>
		public const long VTYPE_CSTRING = 24;
		
		// <summary>
        // TD_CSTRING           = 24,
        // </summary>
		public const long VTYPE_ASTRING = 25;
		
		// <summary>
        // TD_ASTRING           = 25,
        // </summary>
		public const long VTYPE_EMPTY_ARRAY = 254;
		
		// 
		public const long VTYPE_EMPTY = 255;
	}
	
	/// <summary>
    /// XPConnect has magic to transparently convert between nsIVariant and JS types.
    /// We mark the interface [scriptable] so that JS can use methods
    /// that refer to this interface. But we mark all the methods and attributes
    /// [noscript] since any nsIVariant object will be automatically converted to a
    /// JS type anyway.
    /// </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("81e4c2de-acac-4ad6-901a-b5fb1b851a0d")]
	public interface nsIVariant
	{
		
		/// <summary>
        /// XPConnect has magic to transparently convert between nsIVariant and JS types.
        /// We mark the interface [scriptable] so that JS can use methods
        /// that refer to this interface. But we mark all the methods and attributes
        /// [noscript] since any nsIVariant object will be automatically converted to a
        /// JS type anyway.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		ushort GetDataTypeAttribute();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		byte GetAsInt8();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		short GetAsInt16();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		int GetAsInt32();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		long GetAsInt64();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		byte GetAsUint8();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		ushort GetAsUint16();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		uint GetAsUint32();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		ulong GetAsUint64();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		float GetAsFloat();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		double GetAsDouble();
		
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetAsBool();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		char GetAsChar();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		char GetAsWChar();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		int GetAsID(ref System.IntPtr retval);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetAsAString([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase retval);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetAsDOMString([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase retval);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetAsACString([MarshalAs(UnmanagedType.LPStruct)] nsACStringBase retval);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetAsAUTF8String([MarshalAs(UnmanagedType.LPStruct)] nsAUTF8StringBase retval);
		
		[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.StringMarshaler")]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		string GetAsString();
		
		[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.WStringMarshaler")]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		string GetAsWString();
		
		[return: MarshalAs(UnmanagedType.Interface)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		nsISupports GetAsISupports();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		Gecko.JsVal GetAsJSVal();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		System.IntPtr GetAsInterface(ref System.Guid iid);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		int GetAsArray(ref ushort type, ref System.Guid iid, ref uint count, ref System.IntPtr ptr);
		
		[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.StringMarshaler", SizeParamIndex=0)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		string GetAsStringWithSize(ref uint size);
		
		[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.WStringMarshaler", SizeParamIndex=0)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		string GetAsWStringWithSize(ref uint size);
	}
	
	/// <summary>
    /// An object that implements nsIVariant may or may NOT also implement this
    /// nsIWritableVariant.
    ///
    /// If the 'writable' attribute is false then attempts to call any of the 'set'
    /// methods can be expected to fail. Setting the 'writable' attribute may or
    /// may not succeed.
    ///
    /// </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("5586a590-8c82-11d5-90f3-0010a4e73d9a")]
	public interface nsIWritableVariant : nsIVariant
	{
		
		/// <summary>
        /// XPConnect has magic to transparently convert between nsIVariant and JS types.
        /// We mark the interface [scriptable] so that JS can use methods
        /// that refer to this interface. But we mark all the methods and attributes
        /// [noscript] since any nsIVariant object will be automatically converted to a
        /// JS type anyway.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new ushort GetDataTypeAttribute();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new byte GetAsInt8();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new short GetAsInt16();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new int GetAsInt32();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new long GetAsInt64();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new byte GetAsUint8();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new ushort GetAsUint16();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new uint GetAsUint32();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new ulong GetAsUint64();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new float GetAsFloat();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new double GetAsDouble();
		
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new bool GetAsBool();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new char GetAsChar();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new char GetAsWChar();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new int GetAsID(ref System.IntPtr retval);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new void GetAsAString([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase retval);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new void GetAsDOMString([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase retval);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new void GetAsACString([MarshalAs(UnmanagedType.LPStruct)] nsACStringBase retval);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new void GetAsAUTF8String([MarshalAs(UnmanagedType.LPStruct)] nsAUTF8StringBase retval);
		
		[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.StringMarshaler")]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new string GetAsString();
		
		[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.WStringMarshaler")]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new string GetAsWString();
		
		[return: MarshalAs(UnmanagedType.Interface)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new nsISupports GetAsISupports();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new Gecko.JsVal GetAsJSVal();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new System.IntPtr GetAsInterface(ref System.Guid iid);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new int GetAsArray(ref ushort type, ref System.Guid iid, ref uint count, ref System.IntPtr ptr);
		
		[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.StringMarshaler", SizeParamIndex=0)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new string GetAsStringWithSize(ref uint size);
		
		[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.WStringMarshaler", SizeParamIndex=0)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		new string GetAsWStringWithSize(ref uint size);
		
		/// <summary>
        /// An object that implements nsIVariant may or may NOT also implement this
        /// nsIWritableVariant.
        ///
        /// If the 'writable' attribute is false then attempts to call any of the 'set'
        /// methods can be expected to fail. Setting the 'writable' attribute may or
        /// may not succeed.
        ///
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetWritableAttribute();
		
		/// <summary>
        /// An object that implements nsIVariant may or may NOT also implement this
        /// nsIWritableVariant.
        ///
        /// If the 'writable' attribute is false then attempts to call any of the 'set'
        /// methods can be expected to fail. Setting the 'writable' attribute may or
        /// may not succeed.
        ///
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetWritableAttribute([MarshalAs(UnmanagedType.U1)] bool aWritable);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsInt8(byte aValue);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsInt16(short aValue);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsInt32(int aValue);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsInt64(long aValue);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsUint8(byte aValue);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsUint16(ushort aValue);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsUint32(uint aValue);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsUint64(ulong aValue);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsFloat(float aValue);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsDouble(double aValue);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsBool([MarshalAs(UnmanagedType.U1)] bool aValue);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsChar(char aValue);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsWChar(char aValue);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsID(System.IntPtr aValue);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsAString([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aValue);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsDOMString([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aValue);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsACString([MarshalAs(UnmanagedType.LPStruct)] nsACStringBase aValue);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsAUTF8String([MarshalAs(UnmanagedType.LPStruct)] nsAUTF8StringBase aValue);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsString([MarshalAs(UnmanagedType.LPStr)] string aValue);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsWString([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.WStringMarshaler")] string aValue);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsISupports([MarshalAs(UnmanagedType.Interface)] nsISupports aValue);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsInterface(ref System.Guid iid, System.IntPtr iface);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsArray(ushort type, System.Guid iid, uint count, System.IntPtr ptr);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsStringWithSize(uint size, [MarshalAs(UnmanagedType.LPStr, SizeParamIndex=0)] string str);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsWStringWithSize(uint size, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.WStringMarshaler", SizeParamIndex=0)] string str);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsVoid();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsEmpty();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAsEmptyArray();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetFromVariant([MarshalAs(UnmanagedType.Interface)] nsIVariant aValue);
	}
}
